package com.binhthuan.catechist.client.grid;

import com.binhthuan.catechist.client.ECApplication;
import com.binhthuan.catechist.client.data.YearDS;
import com.binhthuan.catechist.shared.constant.Parameter;
import com.smartgwt.client.widgets.grid.ListGridField;

public class YearGrid extends AbstractGrid {

    public YearGrid(YearDS dataSource) {
        super(dataSource);
        setWrapCells(true);

        ListGridField idField = new ListGridField(Parameter.ID);
        idField.setHidden(true);
        idField.setCanHide(false);

        ListGridField startDateField = new ListGridField(Parameter.START_DATE);
        startDateField.setTitle(ECApplication.getConstants().startDate());
        startDateField.setWidth(150);
        
        ListGridField endDateField = new ListGridField(Parameter.END_DATE);
        endDateField.setTitle(ECApplication.getConstants().endDate());
        endDateField.setWidth(150);

        ListGridField descriptionField = new ListGridField(Parameter.DESCRIPTION);
        descriptionField.setTitle(ECApplication.getConstants().description());

        setSortField(Parameter.START_DATE);
        setFields(idField, descriptionField, startDateField, endDateField);
    }
}
